package service

import (
	"affairs/dao"
	"affairs/model"
	"affairs/param"
	"affairs/tool"
	"fmt"
)

type UserService struct {
	
}

func (user *UserService) GetInfo (id int)  bool{
	userInfo := model.User{Phone: "15828420676"}
	userDao := dao.UserDao{tool.DbEngine}
	result := userDao.InsertUser(userInfo)
	if result > 0 {
		return true
	}
	return false
}

func (user *UserService) UserLogin(param param.UserLoginParam) *model.User{
	userDao := dao.UserDao{}
	userInfo := userDao.GetInfoByPhone(param.Phone)
	fmt.Println(userInfo)
	if userInfo.Password == param.Password{
		return nil
	}
	 return nil
}